<!DOCTYPE html>
<html lang="">

<head>
    <meta charset="utf-8">
    <meta name="description" content="" />
    <meta name="keywords" content="" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="viewport" content="initial-scale=1, maximum-scale=3, minimum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <title>注册</title>
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="iconfont/iconfont.css">
    <link rel="stylesheet" href="css/login.css">
    <script src="https://cdn.bootcss.com/jquery/1.9.1/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/layer/3.0.3/layer.min.js"></script>
    <link href="https://cdn.bootcss.com/layer/3.0.3/mobile/need/layer.min.css" rel="stylesheet">
    <script src="js/api.js"></script>
    <script src="js/com.js"></script>
</head>
<style>

</style>

<body>
    <div class="dk-body-bg">
        <div class="dk-login-box border-r6"> <img src="images/logo.png" alt="" class="dk-form-logo" />
            <div class="dk-login-title">
                <h2 class="txt-c">找大咖注册</h2> </div>
            <form id="reg-form" method="post">
                <div class="dk-form-group" class="">
                    <input type="text" placeholder="请输入你的手机号码" class="dk-full-input" id="r-mobile" name=""> <span></span> </div>
                <div class="dk-form-group">
                    <input type="text" placeholder="请输入验证码" class="dk-full-input" id="dk-getCode" name="">
                    <input type="button" class="dk-getCode bg-blue border-r6" value="获取验证码"> </div>
                <div class="dk-form-group">
                    <input type="password" placeholder="密码为6~16位，必须有数字和字母 " class="dk-full-input" id="r-pwd1" name=""><span></span> </div>
                <div class="dk-form-group">
                    <input type="password" placeholder="请重复输入密码" class="dk-full-input" id="r-pwd2" name=""><span></span> </div>
                <div class="dk-form-group border-clear">
                    <button type="button" class="bg-blue dk-default-btn" id="dk-reg-btn">提交</button>
                </div>
                <div class="clearfix"> <span class="fl ">没有账号？现在<a href="login.html" class="fc-blue fs-h2">登录</a></span> <a href="login.html" class="fr"><i class="iconfont" style="font-size: 28px;">&#xe650;</i></a> </div>
            </form>
        </div>
    </div>
   
    <script>    
        //获取验证码
        $(".dk-getCode").click(function () {
            var mobile = $("#r-mobile").val();
            var data={
                'mobile': mobile,
                'type':0
            };
            if (form_check('phone', "#r-mobile")) {
                User.Post(User.sendcode,data,function(obj) {
                    if (obj.code=="200") {
                    	msg(obj.msg,function(){
                    		 settime(".dk-getCode", 60);
                    	})
                    }else{
                        msg(obj.msg,function(){
                        	
                        })
                    }
                });
            }
        });
        //提交表单
        $("#dk-reg-btn").click(function () {
            var mobile = $("#r-mobile").val();
            var pwd = $("#r-pwd1").val();
            var pwd1 = $("#r-pwd2").val();
            var vali = $("#dk-getCode").val();
            var inviter_id=""//d
            var data = {"inviter_id":1,"username": mobile, "password": pwd, "code": vali}
            if (form_check('phone', "#r-mobile") && !vali=="" && form_check('pwd', "#r-pwd1") && pwdvali("#r-pwd2", "#r-pwd1")) {
                User.Post(User.register, data, function (obj) {
                    if (obj.code=="200") {
                    	msg(obj.msg,function(){
                    		herf("login.html");
                    	})	
                    
                    }else{
                    	msg(obj.msg)
                    }
                })
            }
        })
    </script>
</body>

</html>